package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * Created by q on 2019/1/2.
 */
@RestController("user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "show", method = RequestMethod.POST)
    @ResponseBody
    public String selInfo(){

        List<User> list = userService.selUserInfo();
        return JSON.toJSONString(list);
    }
}
